package com.kuang.util;

import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.nlf.calendar.Lunar;
import com.nlf.calendar.Solar;

import java.util.Date;

/**
 * @ClassName test
 * @Description: TODO
 * @Author: liaosheng
 * @Create: 2025-06-13 15:17
 * @Version 1.0
 **/
public class test {

    public static void main(String[] args) {
        // 实例化
        Lunar lunar = Lunar.fromYmd(2025, 6, 8);
        System.out.println(lunar);  //农历    二〇二三年冬月初八
        // 转阳历
        Solar solar = lunar.getSolar();
        System.out.println(solar.toString());  //阳历 2023-12-20
        System.out.println(solar.toFullString());  //2023-12-20 00:00:00 星期三 射手座

        Lunar d = Lunar.fromDate(new Date());
        System.out.println(d);
        System.out.println(d.toFullString());

        System.out.println(d.getYear());
        System.out.println(d.getMonth());
        System.out.println(d.getDay());

        System.out.println(d.getYearInChinese());
        System.out.println(d.getMonthInChinese());
        System.out.println(d.getDayInChinese());
    }
}